package m.html.element;

import m.html.element.other.InputElement;
import m.system.util.StringUtil;

public class InputNumber extends InputElement {

	public InputNumber(String field) {
		this(field,null);
	}
	public InputNumber(String field,String suffix){
		this(field,suffix,"#,##0.00",2);
	}
	public InputNumber(String field,String suffix,String viewFormat,int precision){
		super("a-input-number");
		super.setField(field);
		super.A(":precision",String.valueOf(precision));
		if(StringUtil.notSpace(suffix))
			super.A("addon-after",suffix);
		viewElement=Element.tag("div").A("class","input-view-box").E("{{formatter('',"+field+",'"+viewFormat+"')}}"+StringUtil.noSpace(suffix));
	}
}
